
using Microsoft.AspNetCore.Builder;
using PersonalWebsite.Shell.Extensions;

namespace PersonalWebsite.Shell
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var builder = WebApplication.CreateBuilder(args);

            builder.Services.AddCors(options =>
            options.AddPolicy("cors",
p => p.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()));
            builder.Services.AddApplication<StartupModule>();

            var app = builder.Build();

            app.UseStaticFiles();
            app.UseCors("cors");
            app.UseDefaultSwaggerUI();
            app.UseAuthorization();
            app.MapControllers();

            app.Run();
        }
    }
}
